﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace MixScript.BLL.FI
{
    public class cAccInterface : cBaseBLL
    {
        public cAccInterface() { }


        public DataSet GetDataInterface()
        {
            DataSet dt = new DataSet();
            for (int i = 1; i <= 8; i++)
            {
                dt.Tables.Add(Dbserver.ExecuteQuery("GetInterface '" + i + "'", ""));
            }
            return dt;
        }
        public void UpdateIntoInterface(String curr, String accNum, String type)
        {
            Dbserver.openConn();
            Dbserver.ExecuteNonQuery(String.Format(@"UPDATE accinterface SET CUR='{0}', accNum='{1}' 
                                                    WHERE InterfaceType='{2}'", curr, accNum, type));
            Dbserver.CommitAndCloseConn();
        }
        public void insertIntoInterface(String curr, String accNum, String type)
        {
            Dbserver.openConn();
            Dbserver.ExecuteNonQuery(String.Format("INSERT INTO accinterface VALUES('{0}','{1}','{2}')", curr, accNum, type));
            Dbserver.CommitAndCloseConn();
        }
        public void DeleteInterface(String ID)
        {
            Dbserver.openConn();
            Dbserver.ExecuteNonQuery(String.Format(@"DELETE accinterface
                                                    WHERE ID='{0}'", ID)); 
            Dbserver.CommitAndCloseConn();
        }



    }
}
